/* 
 * File:   temperature.h
 * Author: apleilx
 */

#ifndef _PINCFG_H_
#define	_PINCFG_H_

#include "p24FV32KA304.h"


#ifdef	__cplusplus
extern "C" {
#endif
    
#define LCD_CS1       LATAbits.LA0
#define LCD_CS1_DIR   TRISAbits.TRISA0
#define LCD_CS2       LATBbits.LB5
#define LCD_CS2_DIR   TRISBbits.TRISB5
#define LCD_CS3       LATBbits.LB4
#define LCD_CS3_DIR   TRISBbits.TRISB4
#define LCD_E         LATAbits.LA2
#define LCD_E_DIR     TRISAbits.TRISA2
#define LCD_RW        LATBbits.LB1
#define LCD_RW_DIR    TRISBbits.TRISB1
#define LCD_RS        LATAbits.LA3
#define LCD_RS_DIR    TRISAbits.TRISA3
#define LCD_BUSY      PORTDbits.RD7
#define LCD_BUSY_DIR  TRISDbits.TRISD7
#define LCD_RESET     LATAbits.LA1
#define LCD_RESET_DIR TRISAbits.TRISA1
#define LCD_DATA      PORTD
#define LCD_DATA_DIR  TRISD

#define HEAT_OUT      LATAbits.LATA8
#define HUMI_OUT      LATBbits.LATB4
#define COOL_OUT      LATCbits.LATC2
#define JK_EN         1
#define JK_DIS        0

#define NOP1()  asm("nop")
#define NOP2()  NOP1();NOP1()
#define NOP3()  NOP2();NOP1()
#define NOP4()  NOP3();NOP1()
#define NOP5()  NOP4();NOP1()
#define NOP6()  NOP5();NOP1()
#define NOP7()  NOP6();NOP1()
#define NOP8()  NOP7();NOP1()
#define NOP9()  NOP8();NOP1()
#define NOP10() NOP9();NOP1()
#define NOP11() NOP10();NOP1()
#define NOP12() NOP11();NOP1()
#define NOP13() NOP12();NOP1()
#define NOP14() NOP13();NOP1()
#define NOP15() NOP14();NOP1()
#define NOP16() NOP15();NOP1()
#define NOP17() NOP16();NOP1()
#define NOP18() NOP17();NOP1()
#define NOP19() NOP18();NOP1()
#define NOP20() NOP19();NOP1()
#define NOP21() NOP20();NOP1()
#define NOP22() NOP21();NOP1()
#define NOP23() NOP22();NOP1()
#define NOP24() NOP23();NOP1()
#define NOP25() NOP24();NOP1()
#define NOP26() NOP25();NOP1()
#define NOP27() NOP26();NOP1()
#define NOP28() NOP27();NOP1()
#define NOP29() NOP28();NOP1()
#define NOP30() NOP29();NOP1()
#define NOP31() NOP30();NOP1()
#define NOP32() NOP31();NOP1()
#define NOP33() NOP32();NOP1()
#define NOP34() NOP33();NOP1()
#define NOP35() NOP34();NOP1()
#define NOP36() NOP35();NOP1()
#define NOP37() NOP36();NOP1()
#define NOP38() NOP37();NOP1()
#define NOP39() NOP38();NOP1()
#define NOP40() NOP39();NOP1()
#define NOP(N)  NOP##N()

#ifdef	__cplusplus
}
#endif


#endif	/* _PINCFG_H_ */

